import { createElement } from "./dom";
export let render = (eleObj, container) => {
  console.log(eleObj);
  let elementNode;
//   debugger
  if (typeof eleObj == "string") {
    elementNode = createElement({ type: String, value: eleObj });
  } else {
    let { type, props, children } = eleObj;
    elementNode = createElement(eleObj); 
    if (children && children.length > 0) {
      children.forEach(element => {
        render(element, elementNode);
      });
    }
  }

  console.log(elementNode);
  container.appendChild(elementNode);
};
